click
Type
command
Summary
Simulates a mouse click.
Syntax
click [[with] button <mouseButtonNumber>] [twice] at <point> [with <key> [, <key> [, <key>]]]
Description
Use the click command to simulate the action of a click, instead of sending a mouseDown or mouseUp message--for example, to create a graphic or image with a handler.
The click command sends a mouseDown and mouseUp message to the object at the clicked location. If two objects both occupy the clicked location--one overlapping the other--the messages are sent to the object on top.
If the twice keyword is specified, then the click command will additionally send a mouseDoubleDown and mouseDoubleUp message to the object at the clicked location after the initial messages to simulate the action of a double-click.
If the object under the point is a button whose autoHilite is true, the click command causes the button to highlight and unhighlight, just as though the user had clicked.
If the point is not within one of the application's windows, the click command has no effect. This means that you cannot use the click command to switch to another application.
Parameters
Name | Type | Description |
---|---|---|
mouseButtonNumber | enum | The number of a mouse button:If you don't specify a mouseButtonNumber, button 1 is used.
|
point | Any expression that evaluates to a point--a vertical and horizontal distance from the top left of the current stack, separated by a comma. | |
key | One of shiftKey, commandKey, optionKey, altKey or controlKey. You can specify up to three keys, separated by commas. |
Examples
click at "100,200"
click button 2 at the loc of field 1
click at the mouseLoc with controlKey
click button 2 at the loc of button "Start"
Related
function: clickLoc, mouseClick
glossary: object, highlight, application, handler, message, graphic, command, image
keyword: button
message: linkClicked, mouseUp, mouseDown, mouseStillDown, mouseDoubleUp, dragStart
property: autoHilite, dragSpeed
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop